package com.heei;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

/**
 * @program: spring-cloud-learning
 * @description: 客户端负载均衡 Consul-consumer-ribbon
 * @author: HuPing
 * @create: 2020-10-22 14:47
 **/
@EnableDiscoveryClient
@SpringBootApplication
public class ApplicationConsulConsumerRibbon {

    @Bean
    @LoadBalanced
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }

    public static void main(String[] args) {
        SpringApplication.run(ApplicationConsulConsumerRibbon.class, args);
    }
}
